package com.kitty.game.rank.model.record;

import lombok.Getter;
import lombok.Setter;

/**元婴血婴排行榜记录*/
@Setter
@Getter
public class ChildLevelRankRecord extends RankRecord {
    private String gid;
    private short level;
    private String partyName;//帮派名
    private String name;//角色名称
    private short polar;//门派 相性

    public ChildLevelRankRecord() {}

    public ChildLevelRankRecord(String gid, short level, String partyName, String name, short polar) {
        this.gid = gid;
        this.level = level;
        this.partyName = partyName;
        this.name = name;
        this.polar = polar;
    }

    @Override
    public int compareTo(RankRecord o) {
        /**按等级从大到小排序*/
        ChildLevelRankRecord other = (ChildLevelRankRecord)o;
        if (level != other.getLevel()) {
            return level > other.getLevel() ? -1 : 1;
        }

        /**等级一样时，就按gid排序吧，保证不是同一个玩家就好了*/
        return gid.compareTo(other.getGid());
    }
}
